{{ template "layout/base.html" . }}

{{define "head"}}
<title>OpenVPN - Settings</title>
{{end}}

{{define "body"}}
<div class="box box-primary">
  <div class="box-header with-border">
    <h3 class="box-title">Edit settings</h3>
  </div>
  <!-- /.box-header -->
  <!-- form start -->
  {{template "common/alert.html" .}}
  <form role="form" action="{{urlfor "SettingsController.Login"}}" method="post">
    <div class="box-body">
      <div class="form-group">
        <label for="name">Profile</label>
        <input type="text" class="form-control" id="Profile" disabled
          value=" {{ .Settings.Profile }} ">
      </div>

      <div class="form-group">
        <label for="name">Management Interface Address</label>
        <input type="text" class="form-control" id="MIAddress" name="MIAddress" placeholder="Enter address"
          value="{{ .Settings.MIAddress }}">
        <span class="help-block">172.17.0.1:2080 recommended with [172.17.0.1 2080] 
          in Configuration - OpenVPN config. Update your server.conf file first, manually
          or by using this WebUI!
        </span>
      </div>

      <div class="form-group">
        <label for="name">Management Interface Protocol</label>
        <input type="text" class="form-control" id="MINetwork" name="MINetwork" placeholder="Enter interface protocol"
          value="{{ .Settings.MINetwork }}">
        <span class="help-block">Protocol for accessing the OpenVPN Management Interface</span>
      </div>

      <div class="form-group">
        <label for="name">Server Address External</label>
        <input type="text" class="form-control" id="ServerAddress" name="ServerAddress" placeholder="Enter server address"
          value="{{ .Settings.ServerAddress }}">
        <span class="help-block">Static public IP address or DDNS hostname e.g. myhostname.duckdns.org</span>
      </div>

      <div class="form-group">
        <label for="name">ConfigPath</label>
        <input type="text" class="form-control" id="OVConfigPath" name="OVConfigPath" placeholder="Enter config path"
          value="{{ .Settings.OVConfigPath }}">
        <span class="help-block">Full path to the OpenVPN installation directory</span>
      </div>

      {{ .xsrfdata }}
    </div>
    <!-- /.box-body -->

    <div class="box-footer">
      <button type="submit" class="btn btn-primary">Save and Apply</button>
    </div>
  </form>

</div>
<!-- /.box -->
{{end}}
